package com.mentaleye.enums;

public enum DisciplineEnums {

	BE_LATE(1,"迟到"),LEAVE_EARLY(2,"早退"),
	SICK_LEAVE(3,"病假"),MATTER_LEAVE(4,"事假"),
	TRUANT(5,"旷课");

    private DisciplineEnums(Integer code, String msg) {
        this.code = code;
    }

    private Integer code;
    private String msg;
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }


    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    /**
     * 根据编码查找枚举
     */
    public static DisciplineEnums find(int code) {
        for (DisciplineEnums frs : DisciplineEnums.values()) {
            if (frs.getCode().intValue() == code) {
                return frs;
            }
        }
        return null;
    }
}
